/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80022 (8.0.22)
 Source Host           : localhost:3305
 Source Schema         : erp

 Target Server Type    : MySQL
 Target Server Version : 80022 (8.0.22)
 File Encoding         : 65001

 Date: 04/12/2024 19:54:01
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for dict
-- ----------------------------
DROP TABLE IF EXISTS `dict`;
CREATE TABLE `dict` (
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` int DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`code`),
  UNIQUE KEY `dict_code_key` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of dict
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for dictItem
-- ----------------------------
DROP TABLE IF EXISTS `dictItem`;
CREATE TABLE `dictItem` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dictCode` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` int DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  KEY `dictItem_dictCode_fkey` (`dictCode`),
  CONSTRAINT `dictItem_dictCode_fkey` FOREIGN KEY (`dictCode`) REFERENCES `dict` (`code`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of dictItem
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for group
-- ----------------------------
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `isDelete` tinyint(1) NOT NULL DEFAULT '0',
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of group
-- ----------------------------
BEGIN;
INSERT INTO `group` (`id`, `name`, `createdAt`, `updatedAt`, `isDelete`, `description`) VALUES ('cm30xhdes000012h13f5w4h81', '前片', '2024-11-03 01:43:14.980', '2024-11-03 01:43:35.133', 0, NULL);
INSERT INTO `group` (`id`, `name`, `createdAt`, `updatedAt`, `isDelete`, `description`) VALUES ('cm30xhgy0000112h1bs11j9sb', '后片', '2024-11-03 01:43:19.560', '2024-11-03 01:43:30.664', 0, NULL);
COMMIT;

-- ----------------------------
-- Table structure for model
-- ----------------------------
DROP TABLE IF EXISTS `model`;
CREATE TABLE `model` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isDelete` tinyint(1) NOT NULL DEFAULT '0',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of model
-- ----------------------------
BEGIN;
INSERT INTO `model` (`id`, `name`, `code`, `description`, `isDelete`, `createdAt`, `updatedAt`) VALUES ('cm30xak4j0000vjmcry0iupfp', '测试型号', '07165#', '测试型号', 0, '2024-11-03 01:37:57.091', '2024-11-03 01:38:06.384');
INSERT INTO `model` (`id`, `name`, `code`, `description`, `isDelete`, `createdAt`, `updatedAt`) VALUES ('cm30xaxil0001vjmcgr0gr1er', '3', '2dd', '2', 1, '2024-11-03 01:38:14.442', '2024-11-03 01:38:17.941');
COMMIT;

-- ----------------------------
-- Table structure for process
-- ----------------------------
DROP TABLE IF EXISTS `process`;
CREATE TABLE `process` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `index` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `styleId` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `process_styleId_fkey` (`styleId`),
  CONSTRAINT `process_styleId_fkey` FOREIGN KEY (`styleId`) REFERENCES `style` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of process
-- ----------------------------
BEGIN;
INSERT INTO `process` (`id`, `index`, `name`, `createdAt`, `updatedAt`, `styleId`) VALUES ('cm3vhk6mx0004vtmw0uub6a1x', 1, '测试', '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769', NULL);
INSERT INTO `process` (`id`, `index`, `name`, `createdAt`, `updatedAt`, `styleId`) VALUES ('cm3vhk6mx0006vtmww6wtoa9u', 2, '测试3', '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769', NULL);
INSERT INTO `process` (`id`, `index`, `name`, `createdAt`, `updatedAt`, `styleId`) VALUES ('cm3vhk6mx0008vtmwco1tnoor', 3, '测试2', '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769', NULL);
INSERT INTO `process` (`id`, `index`, `name`, `createdAt`, `updatedAt`, `styleId`) VALUES ('cm3vi5kzi000dvtmw5trcr4nq', 1, '测试1', '2024-11-24 11:15:02.142', '2024-11-24 11:15:02.142', 'cm3vgnvlk000ms1g91befv2ju');
INSERT INTO `process` (`id`, `index`, `name`, `createdAt`, `updatedAt`, `styleId`) VALUES ('cm3vi5kzi000fvtmwgteqon11', 2, '测试3', '2024-11-24 11:15:02.142', '2024-11-24 11:15:02.142', 'cm3vgnvlk000ms1g91befv2ju');
COMMIT;

-- ----------------------------
-- Table structure for processPrice
-- ----------------------------
DROP TABLE IF EXISTS `processPrice`;
CREATE TABLE `processPrice` (
  `processId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sizeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` double NOT NULL,
  PRIMARY KEY (`sizeId`,`processId`),
  KEY `processPrice_processId_fkey` (`processId`),
  CONSTRAINT `processPrice_processId_fkey` FOREIGN KEY (`processId`) REFERENCES `process` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `processPrice_sizeId_fkey` FOREIGN KEY (`sizeId`) REFERENCES `size` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of processPrice
-- ----------------------------
BEGIN;
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0004vtmw0uub6a1x', 'cm30xsnn0000212h1x7mvh8o1', 4);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0006vtmww6wtoa9u', 'cm30xsnn0000212h1x7mvh8o1', 5);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0008vtmwco1tnoor', 'cm30xsnn0000212h1x7mvh8o1', 1);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000dvtmw5trcr4nq', 'cm30xsnn0000212h1x7mvh8o1', 1);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000fvtmwgteqon11', 'cm30xsnn0000212h1x7mvh8o1', 5);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0004vtmw0uub6a1x', 'cm30xy33i0000tj3q1zt486mt', 4);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0006vtmww6wtoa9u', 'cm30xy33i0000tj3q1zt486mt', 5);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0008vtmwco1tnoor', 'cm30xy33i0000tj3q1zt486mt', 2);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000dvtmw5trcr4nq', 'cm30xy33i0000tj3q1zt486mt', 2);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000fvtmwgteqon11', 'cm30xy33i0000tj3q1zt486mt', 5);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0004vtmw0uub6a1x', 'cm30xy8mc0001tj3qjzo59dp5', 4);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0006vtmww6wtoa9u', 'cm30xy8mc0001tj3qjzo59dp5', 5);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vhk6mx0008vtmwco1tnoor', 'cm30xy8mc0001tj3qjzo59dp5', 3);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000dvtmw5trcr4nq', 'cm30xy8mc0001tj3qjzo59dp5', 3);
INSERT INTO `processPrice` (`processId`, `sizeId`, `price`) VALUES ('cm3vi5kzi000fvtmwgteqon11', 'cm30xy8mc0001tj3qjzo59dp5', 5);
COMMIT;

-- ----------------------------
-- Table structure for processTemplate
-- ----------------------------
DROP TABLE IF EXISTS `processTemplate`;
CREATE TABLE `processTemplate` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  UNIQUE KEY `processTemplate_name_key` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of processTemplate
-- ----------------------------
BEGIN;
INSERT INTO `processTemplate` (`id`, `name`, `description`, `createdAt`, `updatedAt`) VALUES ('cm3vhjv4i0002vtmwgutzzxvv', '测试1', NULL, '2024-11-24 10:58:08.850', '2024-11-24 10:58:08.850');
INSERT INTO `processTemplate` (`id`, `name`, `description`, `createdAt`, `updatedAt`) VALUES ('cm3vhk6mx0009vtmwkyirvmmb', '测试', NULL, '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769');
INSERT INTO `processTemplate` (`id`, `name`, `description`, `createdAt`, `updatedAt`) VALUES ('cm3vhk6mx000avtmw4gyphsgj', '测试3', NULL, '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769');
INSERT INTO `processTemplate` (`id`, `name`, `description`, `createdAt`, `updatedAt`) VALUES ('cm3vhk6my000bvtmwjbwb9b6y', '测试2', NULL, '2024-11-24 10:58:23.769', '2024-11-24 10:58:23.769');
COMMIT;

-- ----------------------------
-- Table structure for processTemplatePrice
-- ----------------------------
DROP TABLE IF EXISTS `processTemplatePrice`;
CREATE TABLE `processTemplatePrice` (
  `sizeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `processTemplateId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` double NOT NULL,
  PRIMARY KEY (`sizeId`,`processTemplateId`),
  KEY `processTemplatePrice_processTemplateId_fkey` (`processTemplateId`),
  CONSTRAINT `processTemplatePrice_processTemplateId_fkey` FOREIGN KEY (`processTemplateId`) REFERENCES `processTemplate` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `processTemplatePrice_sizeId_fkey` FOREIGN KEY (`sizeId`) REFERENCES `size` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of processTemplatePrice
-- ----------------------------
BEGIN;
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xsnn0000212h1x7mvh8o1', 'cm3vhjv4i0002vtmwgutzzxvv', 1);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xsnn0000212h1x7mvh8o1', 'cm3vhk6mx0009vtmwkyirvmmb', 4);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xsnn0000212h1x7mvh8o1', 'cm3vhk6mx000avtmw4gyphsgj', 5);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xsnn0000212h1x7mvh8o1', 'cm3vhk6my000bvtmwjbwb9b6y', 1);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy33i0000tj3q1zt486mt', 'cm3vhjv4i0002vtmwgutzzxvv', 2);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy33i0000tj3q1zt486mt', 'cm3vhk6mx0009vtmwkyirvmmb', 4);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy33i0000tj3q1zt486mt', 'cm3vhk6mx000avtmw4gyphsgj', 5);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy33i0000tj3q1zt486mt', 'cm3vhk6my000bvtmwjbwb9b6y', 2);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy8mc0001tj3qjzo59dp5', 'cm3vhjv4i0002vtmwgutzzxvv', 3);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy8mc0001tj3qjzo59dp5', 'cm3vhk6mx0009vtmwkyirvmmb', 4);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy8mc0001tj3qjzo59dp5', 'cm3vhk6mx000avtmw4gyphsgj', 5);
INSERT INTO `processTemplatePrice` (`sizeId`, `processTemplateId`, `price`) VALUES ('cm30xy8mc0001tj3qjzo59dp5', 'cm3vhk6my000bvtmwjbwb9b6y', 3);
COMMIT;

-- ----------------------------
-- Table structure for record
-- ----------------------------
DROP TABLE IF EXISTS `record`;
CREATE TABLE `record` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `processId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `workerId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` int NOT NULL,
  `date` datetime(3) NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `userId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sizeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `styleId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `record_processId_fkey` (`processId`),
  KEY `record_workerId_fkey` (`workerId`),
  KEY `record_userId_fkey` (`userId`),
  KEY `record_sizeId_fkey` (`sizeId`),
  KEY `record_styleId_fkey` (`styleId`),
  CONSTRAINT `record_processId_fkey` FOREIGN KEY (`processId`) REFERENCES `process` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `record_sizeId_fkey` FOREIGN KEY (`sizeId`) REFERENCES `size` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `record_styleId_fkey` FOREIGN KEY (`styleId`) REFERENCES `style` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `record_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `record_workerId_fkey` FOREIGN KEY (`workerId`) REFERENCES `worker` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of record
-- ----------------------------
BEGIN;
INSERT INTO `record` (`id`, `processId`, `workerId`, `number`, `date`, `description`, `createdAt`, `updatedAt`, `userId`, `sizeId`, `styleId`) VALUES ('cm3zscjsa0001x81nt0kd0o6k', 'cm3vi5kzi000dvtmw5trcr4nq', 'cm3vjtzq7000012f7endrd8p0', 100, '2024-11-27 11:03:13.465', '111', '2024-11-27 11:11:28.043', '2024-11-27 12:04:43.945', 'cm30x24xm00023vf5grq7vhoq', 'cm30xy33i0000tj3q1zt486mt', 'cm3vgnvlk000ms1g91befv2ju');
INSERT INTO `record` (`id`, `processId`, `workerId`, `number`, `date`, `description`, `createdAt`, `updatedAt`, `userId`, `sizeId`, `styleId`) VALUES ('cm41b9a600001wpebj3h97wm3', 'cm3vi5kzi000dvtmw5trcr4nq', 'cm3vjtzq7000012f7endrd8p0', 10, '2024-11-28 12:48:20.038', NULL, '2024-11-28 12:48:34.488', '2024-11-28 12:48:34.488', 'cm30x24xm00023vf5grq7vhoq', 'cm30xy33i0000tj3q1zt486mt', 'cm3vgnvlk000ms1g91befv2ju');
INSERT INTO `record` (`id`, `processId`, `workerId`, `number`, `date`, `description`, `createdAt`, `updatedAt`, `userId`, `sizeId`, `styleId`) VALUES ('cm41bakgt0003wpebdysfy4qg', 'cm3vi5kzi000fvtmwgteqon11', 'cm3vjtzq7000012f7endrd8p0', 20, '2024-11-28 12:49:10.370', NULL, '2024-11-28 12:49:34.494', '2024-11-28 12:49:34.494', 'cm30x24xm00023vf5grq7vhoq', 'cm30xy8mc0001tj3qjzo59dp5', 'cm3vgnvlk000ms1g91befv2ju');
COMMIT;

-- ----------------------------
-- Table structure for size
-- ----------------------------
DROP TABLE IF EXISTS `size`;
CREATE TABLE `size` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `isDelete` tinyint(1) NOT NULL DEFAULT '0',
  `weight` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of size
-- ----------------------------
BEGIN;
INSERT INTO `size` (`id`, `name`, `description`, `createdAt`, `updatedAt`, `isDelete`, `weight`) VALUES ('cm30xsnn0000212h1x7mvh8o1', '小号', NULL, '2024-11-03 01:52:01.450', '2024-11-24 10:33:31.251', 0, 1);
INSERT INTO `size` (`id`, `name`, `description`, `createdAt`, `updatedAt`, `isDelete`, `weight`) VALUES ('cm30xy33i0000tj3q1zt486mt', '中号', NULL, '2024-11-03 01:56:14.766', '2024-11-24 10:33:31.251', 0, 2);
INSERT INTO `size` (`id`, `name`, `description`, `createdAt`, `updatedAt`, `isDelete`, `weight`) VALUES ('cm30xy8mc0001tj3qjzo59dp5', '大号', NULL, '2024-11-03 01:56:21.920', '2024-11-24 10:33:31.251', 0, 4);
COMMIT;

-- ----------------------------
-- Table structure for style
-- ----------------------------
DROP TABLE IF EXISTS `style`;
CREATE TABLE `style` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `modelId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `groupId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isDelete` tinyint(1) NOT NULL DEFAULT '0',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  UNIQUE KEY `style_modelId_groupId_key` (`modelId`,`groupId`),
  KEY `style_groupId_fkey` (`groupId`),
  CONSTRAINT `style_groupId_fkey` FOREIGN KEY (`groupId`) REFERENCES `group` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `style_modelId_fkey` FOREIGN KEY (`modelId`) REFERENCES `model` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of style
-- ----------------------------
BEGIN;
INSERT INTO `style` (`id`, `modelId`, `groupId`, `description`, `isDelete`, `createdAt`, `updatedAt`) VALUES ('cm3vgnvlk000ms1g91befv2ju', 'cm30xak4j0000vjmcry0iupfp', 'cm30xhgy0000112h1bs11j9sb', '测试2', 0, '2024-11-24 10:33:16.471', '2024-11-25 13:53:36.945');
INSERT INTO `style` (`id`, `modelId`, `groupId`, `description`, `isDelete`, `createdAt`, `updatedAt`) VALUES ('cm3x36tco00011386chsj8s2y', 'cm30xak4j0000vjmcry0iupfp', 'cm30xhdes000012h13f5w4h81', NULL, 0, '2024-11-25 13:51:37.751', '2024-11-25 13:51:37.751');
COMMIT;

-- ----------------------------
-- Table structure for styleOnSize
-- ----------------------------
DROP TABLE IF EXISTS `styleOnSize`;
CREATE TABLE `styleOnSize` (
  `styleId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sizeId` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`styleId`,`sizeId`),
  KEY `styleOnSize_sizeId_fkey` (`sizeId`),
  CONSTRAINT `styleOnSize_sizeId_fkey` FOREIGN KEY (`sizeId`) REFERENCES `size` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `styleOnSize_styleId_fkey` FOREIGN KEY (`styleId`) REFERENCES `style` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of styleOnSize
-- ----------------------------
BEGIN;
INSERT INTO `styleOnSize` (`styleId`, `sizeId`, `amount`) VALUES ('cm3vgnvlk000ms1g91befv2ju', 'cm30xsnn0000212h1x7mvh8o1', 110);
INSERT INTO `styleOnSize` (`styleId`, `sizeId`, `amount`) VALUES ('cm3vgnvlk000ms1g91befv2ju', 'cm30xy33i0000tj3q1zt486mt', 110);
INSERT INTO `styleOnSize` (`styleId`, `sizeId`, `amount`) VALUES ('cm3vgnvlk000ms1g91befv2ju', 'cm30xy8mc0001tj3qjzo59dp5', 110);
INSERT INTO `styleOnSize` (`styleId`, `sizeId`, `amount`) VALUES ('cm3x36tco00011386chsj8s2y', 'cm30xsnn0000212h1x7mvh8o1', 100);
INSERT INTO `styleOnSize` (`styleId`, `sizeId`, `amount`) VALUES ('cm3x36tco00011386chsj8s2y', 'cm30xy33i0000tj3q1zt486mt', 100);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `iv` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `openid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remark` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `disabled` tinyint(1) NOT NULL DEFAULT '0',
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `role` enum('admin','finance','worker') COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_username_key` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `username`, `password`, `iv`, `key`, `name`, `avatar`, `openid`, `mobile`, `mail`, `remark`, `disabled`, `createdAt`, `updatedAt`, `role`) VALUES ('cm2g06kxd0000qvh7aov4u3d0', 'admin', 'c2OR3mLOwaA6wRZs7+JotA==', '7593714745412877', '9ecddf504d6eea0ded6d45a74804fcab', '管理员', NULL, NULL, NULL, NULL, '测试', 0, '2024-10-19 10:15:40.657', '2024-10-20 10:22:33.073', 'admin');
INSERT INTO `user` (`id`, `username`, `password`, `iv`, `key`, `name`, `avatar`, `openid`, `mobile`, `mail`, `remark`, `disabled`, `createdAt`, `updatedAt`, `role`) VALUES ('cm30wrslk00013vf5jkb3hqz1', 'worker', '3sQpT1uGuA9q7yyiVd3T/A==', '6263578329401662', '88726195d78c9ec6e6650b98272122de', '员工', NULL, NULL, NULL, NULL, NULL, 0, '2024-11-03 01:23:21.606', '2024-11-03 01:23:21.606', 'worker');
INSERT INTO `user` (`id`, `username`, `password`, `iv`, `key`, `name`, `avatar`, `openid`, `mobile`, `mail`, `remark`, `disabled`, `createdAt`, `updatedAt`, `role`) VALUES ('cm30x24xm00023vf5grq7vhoq', 'caiwu', 'v487iKSqERtTT0HAhKcQdg==', '7179290012199687', '78736c14b773d6848ec390404cb9e5f3', '财务', NULL, NULL, NULL, NULL, NULL, 0, '2024-11-03 01:31:24.153', '2024-11-03 01:31:24.153', 'finance');
COMMIT;

-- ----------------------------
-- Table structure for worker
-- ----------------------------
DROP TABLE IF EXISTS `worker`;
CREATE TABLE `worker` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `age` int DEFAULT NULL,
  `sex` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `disabled` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `worker_code_key` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of worker
-- ----------------------------
BEGIN;
INSERT INTO `worker` (`id`, `code`, `name`, `description`, `mobile`, `age`, `sex`, `createdAt`, `updatedAt`, `disabled`) VALUES ('cm3vjtzq7000012f7endrd8p0', '001', '李江峰', 'ces 测试', '15068218600', 44, '男', '2024-11-24 12:02:00.607', '2024-11-24 12:06:44.964', 0);
INSERT INTO `worker` (`id`, `code`, `name`, `description`, `mobile`, `age`, `sex`, `createdAt`, `updatedAt`, `disabled`) VALUES ('cm3x0s0i90000gq90h4mfhxgg', '002', '张三', '222', '18067011170', 23, '女', '2024-11-25 12:44:07.950', '2024-11-25 12:44:07.950', 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
